﻿using System.Web.Services;
using HMIS.Infrastructure.Core.Authority;
using HMIS.MVC.CommonSupport;
using System.Collections.Generic;
using HMIS.FrameWork.DomainBase;
using HMIS.FrameWork.DomainModel;

namespace HMIS.Site.Services
{
	/// <summary>
	/// InfraUser 的摘要说明
	/// </summary>
	[WebService(Namespace = "http://infraSys.org/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
	// [System.Web.Script.Services.ScriptService]
	public class InfraUser : System.Web.Services.WebService
	{

		[WebMethod]
		public string HelloWorld()
		{
			return "Hello World";
		}

		[WebMethod]
		public InfraUserInfo UserLogin(string userNa, string userPw)
		{	
			userPw = HospUser.GetPwdMD5(userPw);
			InfraUserService userService = new InfraUserService();
			return userService.UserLogin(userNa, userPw);
		}

		[WebMethod]
		public SoapRepEntity ChangePwd(string userNa, string oldPwd, string newPwd)
		{
			InfraUserService userService = new InfraUserService();
			return userService.ChangePwd(userNa, oldPwd, newPwd);
		}
	}
}
